package pattern.state.model;

public class FirstGear extends Gear {

	public FirstGear(Car car) {
		this.car = car;
	}
	
	@Override
	public void accelerate() throws Exception {
		car.setText("Faster? switch to 2 gear..");
		car.setState(car.getSecondGear());
		
	}

	@Override
	public void slowDown() throws Exception {
		throw new IllegalStateException("Can't be slower...");
		
	}

	@Override
	public void goBack() throws Exception {
		car.setText("From 1 gear to reverse? OK, but risky!");
		car.setState(car.getReverse());
		
	}

	@Override
	public void stop() throws Exception {
		car.setText("Stop --- Neutral");
		car.setState(car.getNeutral());
		
	}

}
